package com.yy.module.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import org.hibernate.annotations.GenericGenerator;

@Entity
@javax.persistence.Table(name="t_table_join")
public class TableJoin {
	public static String OneToMany = "OneToMany";
	public static String ManyToOne = "ManyToOne";
	public static String OneToOne = "OneToOne";
	public static String ManyToMany = "ManyToMany";
	
	private String id;
	private String tableName1;//主表ID
	private String fieldName1;//主表关联字段ID
	private String tableName2;//副表ID
	private String fieldName2;//副表关联字段ID
	private String joinType;//关系，OneToMany、ManyToOne、OneToOne、ManyToMany
	private Integer isNotNull = 1;//管理关系不能为空(1：关系为join，0：关系是 a.id=b.pId(+))

	@Id
	@Column(name="ID", length = 32, nullable = false)
    @GeneratedValue(generator = "uuid2" )//指定生成器名称
    @GenericGenerator(name = "uuid2", strategy = "org.hibernate.id.UUIDGenerator" )
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getTableName1() {
		return tableName1;
	}
	public void setTableName1(String tableName1) {
		this.tableName1 = tableName1;
	}
	public String getFieldName1() {
		return fieldName1;
	}
	public void setFieldName1(String fieldName1) {
		this.fieldName1 = fieldName1;
	}
	public String getTableName2() {
		return tableName2;
	}
	public void setTableName2(String tableName2) {
		this.tableName2 = tableName2;
	}
	public String getFieldName2() {
		return fieldName2;
	}
	public void setFieldName2(String fieldName2) {
		this.fieldName2 = fieldName2;
	}
	public String getJoinType() {
		return joinType;
	}
	public void setJoinType(String joinType) {
		this.joinType = joinType;
	}
	public Integer getIsNotNull() {
		return isNotNull;
	}
	public void setIsNotNull(Integer isNotNull) {
		this.isNotNull = isNotNull;
	}
}